package com.hezuti.info.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Property;
import org.springframework.stereotype.Component;
import com.hezuti.common.dao.BaseHibernateDaoGeneric;
import com.hezuti.info.domain.District;

@Component
public class DistrictDao  extends BaseHibernateDaoGeneric<District>{

	/**
	 * 通过城市的id 找到 城市所有的区县
	 * 
	 * @param cid
	 * @return
	 */
	public List<District> findAllByCid(int cid){
		Criteria criteria = this.createCriteria(Property.forName(
				District.FEILD_CID).eq(cid));
		return this.findBy(criteria);
		
	}
	
}
